<?php
session_start ();
?>  

<?php
$gioHang = $this->gioHang;
$count = count ( $gioHang );
$totalItem = $this->totalItem;
$tongTien = $this->tongTien;
$cartService = Application_Model_service_CartService::getInstance ();
$cartService instanceof Application_Model_service_CartService;
?>

<?php
if ($totalItem == '') {
	$totalItem = 0;
}
if ($tongTien == '') {
	$tongTien = 0;
}
?>

<?php
if($gioHang!='') {
	
 Foreach ( $gioHang as $id => $sl ) {
		$sanPham = $cartService->getSanPham ( $id );
		foreach ($sanPham as $sp):
		$soLuong=$sl;
		$donGia=$sp['giaBan'];
		$thanhTien=$soLuong*$donGia;
		$tongTien+=$thanhTien;
		$totalItem+=1;
		endforeach;
}
}
?>


<div class="cart_title">Trạng thái giỏ hàng</div>
        <div class="cart_details"> <?php echo $totalItem?> sản phẩm <br />
          <span class="border_cart"></span> Tổng giá: <span class="price"><?php echo $tongTien?>$</span> </div>
        <div class="cart_icon"><a href="../cart/xemgiohang" title="header=[Xem giỏ hàng] body=[&nbsp;] fade=[on]"><img src="../images/shoppingcart.png" alt="" width="48" height="48" border="0" /></a></div>